

let db=require('../db/index')

exports.alterUserImgAPI=(req,res)=>{

    // --修改 UPDATE user  set email = '111' WHERE username ='ooo'
// DELETE FROM `student` WHERE id = 1
    // var sql=`delete from article where id ='${req.query.id}' `
    var sql = `update user set imgurl = '${req.query.imgurl}' where username ='${req.query.username}'`

    db.query(sql,[
        req.query.user,
        req.query.title,
        req.query.id,
        req.query.content,
        req.query.date,
        req.query.class,
      
    ],(err,data)=>{
        if(err){
            return res.send('错误:'+err.message+'找不到该用户')
        }
        res.send(data)
    })
}